﻿
<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/taglib.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>    
    <title>DataConverge</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <script type="text/javascript">
    window.onload=function message()
    {
       var msg = '<c:out value="${msg}"/>';
       if (msg != null && msg!="") {
             alert(msg);
       }
    }
    	function modify(){
    		var id=document.getElementById("subjectId").value;
    		var state=document.getElementById("status").value;
    		//alert(" state is "+state+" subject id is "+id);
    		document.location.href="subject.htm?action=modifySubject&subjectId="+id+"&state="+state;
    	}
       function goback(){
      	var page=document.form0.page.value;
      	if(page!=""){
      		document.location.href='subject.htm?action=listMySubjects&ec_p='+page;
      	}else{
      		document.location.href='subject.htm?action=listMySubjects';
      	}
      }
      function gobacksch(){
      	var page=document.form0.page.value;
      	//alert('${my}');
      	if(page!=""){
      	    if('${my}'=='N')
      		document.location.href='subject.htm?action=listSchSubjects&ec_p='+page;
      		else if('${my}'=='Y')
      		document.location.href='subject.htm?action=listMySubjects&ec_p='+page;
      		else
      		//my==s;
      		document.location.href='subject.htm?action=listMyJoinedSubjects&ec_p='+page;
      	}else{
      		if('${my}'=='N')
      		document.location.href='subject.htm?action=listSchSubjects';
      		else if('${my}'=='Y')
      		document.location.href='subject.htm?action=listMySubjects';
      		else
      		document.location.href='subject.htm?action=listMyJoinedSubjects';
      	}
      }
      
    </script>
  </head>
  
  <body>
   <br>
     <div align="center"><h4>修改课题状态</h4></div>
     <input type="hidden" value="${subject.id}" name="subjectId" id="subjectId">  
     <input type="hidden" value="申报中" name="status" id="status">
     <form name="form0">
     <input type="hidden" value="${page}" name="page" id="page">
     <table width="80%"  border="1" align="center" height="20%">      
  		<tr>
  		  <td>课题名称</td>
    	  <td><c:out value="${subject.subjectName}"/></td>   
 	    </tr>
 	    <tr>
  		  <td>课题状态</td>
    	  <td><c:if test="${subject.state=='0'}">          		
            	 	<c:out value="申报中"/>           	
              	</c:if>
             	<c:if test="${subject.state=='1'}">
            	 	<c:out value="中标"/>     
             	</c:if>
              	<c:if test="${subject.state=='2'}">
            		<c:out value="在研"/>
             	</c:if>                      
 				<c:if test="${subject.state=='3'}">
            		<c:out value="申请结题"/>
            	</c:if>
            	<c:if test="${subject.state=='4'}">          		
            		<c:out value="已结题"/>
            	</c:if>
            	<c:if test="${subject.state=='5'}">
            		<c:out value="未中标"/>
            	</c:if>
            	<c:if test="${subject.state=='6'}">
            		<c:out value="推荐中标"/>
            	</c:if>
          </td>   
 	    </tr>
 	    <tr>
 	      <td>状态修改为</td>
    	  <td>
    	  	<input type="radio" name="state" onclick="document.getElementById('status').value='0';">申报中
  	 		<input type="radio" name="state" onclick="document.getElementById('status').value='5'">未中标
  	 		<c:if test="${advise=='N'}">
  	 		<input type="radio" name="state" onclick="document.getElementById('status').value='6'">推荐中标
  	 		</c:if>
  	 		<c:if test="${advise=='Y'&&subject.state=='6'}">
  	 		<input type="radio" name="state" onclick="document.getElementById('status').value='1'">中标
  	 		</c:if>
  	 		<input type="radio" name="state" onclick="document.getElementById('status').value='2'">在研
  	 		<input type="radio" name="state" onclick="document.getElementById('status').value='3'">申请结题
  	 		<input type="radio" name="state" onclick="document.getElementById('status').value='4'">已结题
    	  </td>
 	    </tr>
     </table>
     </form>
     <br>
     <div align="center">          
          <input type="button" value="提交修改" onclick="modify();">&nbsp;&nbsp;
     <!-- input type="button" value="返回" onclick="goback();"-->
     <input type="button" value="返回" onclick="gobacksch();"></div>
  </body>
</html>
